home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / TECHNICA / AUTOCAD / H108.ZIP / MM10.ZIP / MM.DOC next >
Text File  |  1991-08-01  |  12KB  |  223 lines

  1.  
  2.                              MM.DOC
  3.  
  4.                    AutoCAD tm  Macro Maker  V 1.00
  5.            Author: Scott Hares  1108 Kelez Dr. San Jose Ca 95120
  6.                         Voice: 408-866-5466
  7.                      CompuServe tm ID 73730,1643
  8.                    Copyright (C) 1991 Scott Hares
  9.  
  10.  INTRODUCTION: 
  11.          MM is a group of utilities for instantly writing and managing keyboard
  12.  macros. Macros can be recorded to handle a one time task that might be very
  13.  tedious or keyboard intensive. A user can also define a group of macros for
  14.  such things as Osnap control, save the list of macros as a file, and load the
  15.  macro file for use in the next editing session manually or automatically. MM 
  16.  utilizes the ansi driver to assign macros to keystrokes. Because of this, MM 
  17.  uses very little memory compared to TSR types of keyboard macros. To further 
  18.  reduce the amount of memory required by MM I have supplied both the raw source 
  19.  code version of MM (MMS.lsp), and Kelvinated source code (MMK.lsp). The source
  20.  code version is for the reference of those interested in viewing the code. The 
  21.  Kelvinated is optimized for memory requirements and load time. Most users will
  22.  prefer to use the Kelvinated MMK.lsp. Just rename MMK.lsp or MMS.lsp to MM.lsp
  23.  Both files will load and run identically except that MMK.lsp might load a few
  24.  seconds faster than MMS.lsp. Be sure to read the READ.ME for more information
  25.  on Kelvination.
  26.  
  27.  
  28.  
  29.  REQUIREMENTS:  Loading, and ansi.sys
  30.          MM is an AutoLISP file and does need to be loaded into memory before
  31.  it can be used. Place the mm.lsp file in your working AutoCAD directory or
  32.  another directory if preferred. From the AutoCAD command prompt enter the
  33.  following:    (load "mm")     and hit return. If you copy mm.lsp to a
  34.  directory other than the working AutoCAD directory, the you must specify the
  35.  path to the mm.lsp file.  (load "c:/acad/utils/mm") for example would be used
  36.  if mm.lsp was installed in a directory c:\acad\utils. Note the use of the
  37.  forward slash instead of the usual backslash in path specification. If these
  38.  steps are followed correctly, then you will see a two line introduction to MM.
  39.          ANSI.SYS driver must be installed. If this system driver is not loaded
  40.  during the boot procedure, then MM will not work. If you are not sure, then
  41.  look at the contents of your config.sys file. You should see a line similar
  42.  to the following:  device = c:\dos\ansi.sys
  43.  I cannot guarantee that MM will work with the many extended or enhanced ansi
  44.  drivers, but those are usually well behaved, and quite compatible with the
  45.  ansi driver issued with DOS.
  46.  
  47.  Summary Of MM Commands:
  48.  MM        Body of MacroMaker program
  49.  MMW       Write Macro File to Hard Disk
  50.  MMLL      Re-Initialize Unloaded Macros
  51.  MMUL      Unload Macros
  52.  MMLF      Load Macro File from Hard Disk
  53.  
  54.  
  55.  SIMPLE MACRO DEFINITION:  MacroMaker
  56.          Alright, suppose you want to change text height of a group of text
  57.  strings. One way is the use the change command to select the text strings
  58.  using cross or window. Then by hitting return several times, you would be
  59.  prompted to enter new height for text. After hitting return several more times
  60.  you would be prompted again for new text height, and on.. and on... until you
  61.  did this for each text string selected. Using MM you could assign this
  62.  sequence to a single keystroke, and save yourself a lot of typing. After
  63.  successfully loading MM it is invoked by type MM at the AutoCAD command 
  64.  prompt. You will be prompted to press a key to re-define. You can use any 
  65.  key including ALT- , SHIFT-, and CNTL- key combinations. Some keys are 
  66.  intercepted by AutoCAD and cannot by used for redefinition. Next you will 
  67.  be prompted to start entering the keystrokes you want assigned to that
  68.  key. Terminate the recording by hitting the ESCape key.
  69.  
  70.  Example: enter mm
  71.  prompt -       "Press the key you wish to assign macro to: "
  72.  press  -        ALT-A key
  73.  prompt -       "Enter the keystrokes to be recorded to macro: "
  74.  enter  -        I_pressed_ALT-A_key
  75.  hit ESCape key
  76.  
  77.  You have assigned the text string "I_pressed_ALT-A_key" to the ALT-A key. Try
  78.  pressing the ALT-A key. The above string should echo onto the command line.
  79.  This macro could have just as easily been an AutoCAD command, set of commands,
  80.  or response to command prompts. Try assigning an AutoCAD command to ALT-A. You
  81.  can redefine a key over and over again during an editing session.
  82.  
  83.  LOADING and UNLOADING MACROS: MMUnloadList and MMLoadList
  84.  If for what ever reason, you decide you want your keyboard to operate without
  85.  macro assignments, you can unload or load macros at will within the same
  86.  editing session. To unload macros type MMUL at the command prompt. In the
  87.  above example we assigned a text string to the ALT-A key. If for some reason
  88.  you need to use ALT-A (shelling to DOS to run another utility for example),
  89.  you can type MMUL and ALT-A would no longer reflect our macro we defined
  90.  above. This is a temporary disabling of defined macros. Temporary because
  91.  those macros could be made available again with MMLL. Try this now, enter MMUL
  92.  to unload the macro we defined above. Now hit ALT-A and nothing happens. Now
  93.  enter MMLL and hit ALT-A and our ALT-A macro is back again. If you want to 
  94.  undefine a single macro assignment, then you should simply assign the 
  95.  original character to the keystroke. For example if you have recorded a macro 
  96.  to the @ key and now want to eliminated that macro so that you can use that 
  97.  character, simply redefine the @ key with a @ character.
  98.  
  99.  SAVING AND LOADING MACRO FILES: MMWrite MMLoadFile
  100.  Now suppose for example you have written macros assigning Osnap commands to
  101.  the ALT-  number keys, and you want to save these macros for use in the future.
  102.  You can save your macros to a file with MMW. You will be prompted for a file
  103.  name. No file extension will be assumed or presumed about the macro file. If
  104.  you use a illegal file name then you might have trouble finding the file
  105.  later on. Once you give a file name to save macros under, you can load this
  106.  file manually or automatically every time you enter the drawing editor.
  107.  Automatic file loading is covered in the next section. For now we will discuss
  108.  only manual loading of macro files. When you leave the AutoCAD drawing editor
  109.  your macros are unloaded and must be reloaded again. If you saved your macros
  110.  to a file you can do this with MMLF. Enter MMLF at the command prompt and you
  111.  will be prompted to enter the name of a macro file to load. If you give a
  112.  valid macro file name the files macros will be loaded and the macros available
  113.  for use immediately. After a macro file is loaded all of the macro managing
  114.  functions discussed will apply.
  115.  
  116.  LOADING MACRO FILES AUTOMATICALLY:
  117.  Loading a macro file requires a bit of pseudo programming but every attempt
  118.  will be made to make this as straight forward and simple as possible. Two
  119.  things are required to perform automatic macro file loading. First is to
  120.  create a very simple script file as follows:
  121.  example listing for MM.scr:
  122.  
  123.  mmlf
  124.  acad.mm
  125.  (graphscr)
  126.  
  127.  That's it!. only three lines. This script file (which must have a file
  128.  extension of .scr) assumes that you have saved a macro file (using MMW
  129.  described above) and that the MM.lsp package has already been loaded. Any
  130.  macro file name you whish to use can be substituted for the acad.mm. , but
  131.  those of you new to AutoLISP might ask "how do we load MM.lsp automatically?"
  132.  Unless you are working with a very old version of AutoCAD, AutoLISP has a
  133.  function called s::startup. As you know, when you enter the drawing editor,
  134.  AutoCAD looks for ACAD.lsp. if AutoCAD finds this file it will automatically
  135.  load it as the last job upon entering the drawing editor. If AutoCAD finds a
  136.  s::startup function in the ACAD.lsp, then the contents of s::startup will be
  137.  executed automatically. This is the key to automatic loading of macro files.
  138.  Here is the listing:
  139.  
  140.  (defun s::startup()
  141.  (command "UNDEFINE" "End")
  142.  (command "UNDEFINE" "Quit")
  143.  (load "mm")
  144.  (command "script" "MM")
  145.  )
  146.  
  147.  When you enter the AutoCAD drawing editor and these automatic events occur,
  148.  you will notice (for single screen users only) that your monitor will briefly
  149.  switch to the text screen (as if you had hit the F1 key) and then flip back to
  150.  the graphics screen. This is because the your single monitor cannot be in a
  151.  graphics mode when MM calls functions from the ansi driver. There is nothing I
  152.  can do about this problem except hope that grateful users can ignore it. You
  153.  will also notice that if you answer "N" to the quit prompt or cancel out of
  154.  the quit command, then macros will unload. I have tried to keep MM as small a
  155.  program as possible, and to eliminate this problem would make MM larger and
  156.  bulkier than it needs to be. Such an occurrence described above should be 
  157.  rare enough to ignore such a problem, but every piece of user input is valued.
  158.  When implementing the above AutoLISP code one should first search for the
  159.  existence of the ACAD.lsp file. If it does not exist, then it is safe to
  160.  create (using your favorite text editor) this file with the above code being
  161.  the only entries. If an ACAD.lsp already exists, the you should search the
  162.  ACAD.lsp code for the key word s::startup .   If no s::startup is found in an
  163.  existing ACAD.lsp file then the above code can be added, but you must be
  164.  careful not to add this code with in some other lisp programs parenthesis.
  165.  Usually it is safe to add this code to the very top or very bottom of an 
  166.  ACAD.lsp. If s::startup is found in an existing ACAD.lsp then you must be 
  167.  extra careful to add the following code only.
  168.  
  169.  (command "UNDEFINE" "End")
  170.  (command "UNDEFINE" "Quit")
  171.  (load "mm")
  172.  (command "script" "MM")
  173.  
  174.  In this case, be careful not to add this code indiscriminately. This code
  175.  should be imbedded in the s::startup function, but not imbedded in any other
  176.  code that may exist in the s::startup function. Before adding such code, save
  177.  your existing ACAD.lsp to something like Acad_lsp.old as a backup incase you find
  178.  yourself in trouble. Because I cannot look at the s::Startup code for end
  179.  users machines I can be of little more help than that I'm afraid. I can however
  180.  offer explicit assistance to users (registered or not) via compuserve Email,
  181.  or U.S. mail.
  182.  
  183.  OLDER VERSIONS OF AutoCAD and AUTOMATIC MACRO FILE LOADING:
  184.  If you are using a very old version of AutoCAD and AutoLISP, then s::startup
  185.  described above might not be a valid AutoLISP function. In this case you are
  186.  stuck!. You can however use a similar script file as above but this script
  187.  must be ran manually upon entering the drawing editor.
  188.  listing:
  189.  
  190.  (load "mm")
  191.  mmlf
  192.  acad.mm
  193.  
  194.  
  195.  TECHNIQUES:
  196.  I have designed MM with the hopes that it can be limited only by users
  197.  imagination. Typically When we hear of a "Hot Key" sequence, reference is
  198.  being made to a Terminate and Stay Resident program. MM allows a sort of
  199.  pseudo Hot Key invocation of AutoCAD commands, AutoLISP functions, external
  200.  programs listed in ACAD.PGP as well as automating tedious repetitive
  201.  keystrokes. I hope to hear from all users, some comments regarding new
  202.  features, problems, complaints, or any other feedback you might have
  203.  (registered or not).
  204.  
  205.  Thank You for evaluating MM and please feel free to give copies to your friends
  206.  and associates. I hope you enjoy MM as much as I did writing it.
  207.  
  208.  Copies distributed must be complete without any modifications or edits, and
  209.  compensation for such distribution is not allowed unless expressly requested
  210.  and excepted by the author of MM. The author cannot be responsible for system
  211.  portability nor loss of any data caused by the use or misuse of MM.
  212.  P.S. My lawyer makes me say this legal mumbo jumbo stuff.
  213.  
  214.  
  215.                           All software and documentation are
  216.                                Copyright (c) 1990 1991 by
  217.                                     Scott D. Hares
  218.                                    1198 Capri drive
  219.                                    Campbell CA 95008
  220.                                 CompuServe ID 73730,1643
  221.  
  222.                AutoCAD and AutoLISP are registered trademark of AutoDESK inc.
  223.